package model

// ResponseResult 通用响应信息
type ResponseResult struct {
	StatusCode int         `json:"statusCode"`
	StatusMsg  string      `json:"statusMsg"`
	Data       interface{} `json:"data"`
}

// Success /**
func Success(data interface{}) *ResponseResult {
	return &ResponseResult{StatusCode: 0, StatusMsg: "SUCCESS", Data: data}
}

// Fail /**
func Fail(statusMsg string) *ResponseResult {
	return &ResponseResult{StatusCode: 1, StatusMsg: statusMsg, Data: nil}
}

// RequestError /**
func RequestError(statusMsg string) *ResponseResult {
	return &ResponseResult{StatusCode: 400, StatusMsg: statusMsg, Data: nil}
}

// ServerError /**
func ServerError(statusMsg string) *ResponseResult {
	return &ResponseResult{StatusCode: 500, StatusMsg: statusMsg, Data: nil}
}
